package com.ruoyi.broker.mapper;

import com.ruoyi.broker.domain.Broker;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * 经纪人数据Mapper接口
 * 
 * @author ruoyi
 * @date 2025-04-09
 */
public interface BrokerMapper 
{
    /**
     * 查询经纪人数据
     * 
     * @param id 经纪人数据主键
     * @return 经纪人数据
     */
    public Broker selectBrokerById(Long id);

    /**
     * 查询经纪人数据列表
     * 
     * @param broker 经纪人数据
     * @return 经纪人数据集合
     */
    public List<Broker> selectBrokerList(Broker broker);

    /**
     * 新增经纪人数据
     * 
     * @param broker 经纪人数据
     * @return 结果
     */
    public int insertBroker(Broker broker);

    /**
     * 修改经纪人数据
     * 
     * @param broker 经纪人数据
     * @return 结果
     */
    public int updateBroker(Broker broker);

    /**
     * 删除经纪人数据
     * 
     * @param id 经纪人数据主键
     * @return 结果
     */
    public int deleteBrokerById(Long id);

    /**
     * 批量删除经纪人数据
     * 
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteBrokerByIds(Long[] ids);

    @Select("select broker_name from t_broker where id = #{brokerId}")
    String selectName(@Param("brokerId") Long brokerId);

    @Update("update t_technician set technician_identity = 0 where id  = #{tid}")
    Integer updateTechnicianType(@Param("tid") Long tid);

    Broker select(@Param("userInvitationCode") String userInvitationCode);
}
